﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameLib.WorldMap;
using GameLib.Serialization;

namespace GameLib.Entities
{
	public class Settlement
	{
		[XmlDataProperty(IsAttribute = true)]
		public string Name
		{
			get;
			set;
		}

		[XmlDataProperty(IsAttribute = true)]
		public Tile Tile
		{
			get { return _Tile; }
			set
			{
				if (_Tile != value)
				{
					if (_Tile != null)
						_Tile.OnSettlementRemoved(this);

					_Tile = value;

					if (_Tile != null)
						_Tile.OnSettlementAdded(this);
				}
			}
		}

		private Tile _Tile;
	}
}
